<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="{TG_URL_ARES}css/aliicon/font.css?time=New Date()">
<avalon ms-skip="" class="avalonHide">
<style id="avalonStyle">
	.main-view{
		font-size: 14px;
	}
	.avalonHide{ display: none!important }
	.nav_item i{
		background: #2e8ded;
		width: 20px;
		height: 20px;
		border-radius: 50%;
		line-height: 20px;
		text-align: center;
		color: #fff;
		display: inline-block;
		margin-right: 5px;
		font-size: 12px;
	}
	.nav_item{padding:10px!important;}
</style>
</avalon>
   <title>{if empty($_Session['btitle'])} {if empty($share_data['sname'])}乐享拼购{else}{$share_data['sname']}{/if}{else}{$_Session['btitle']} {/if}</title>
    {php echo register_jssdk();}
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta http-equiv="Pragma" content="no-cache">   
    <meta http-equiv="Cache-Control" content="no-store">
    <meta http-equiv="Expires" content="0">
    <LINK  href="../addons/feng_fightgroups/template/css/style_366c9ef.css" rel="stylesheet">    
    <LINK  href="../addons/feng_fightgroups/template/css/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body avalonctrl="root">
    <div class="container">
        <section class="main-view">
            
            <div> 
                <div class="nav">
                    <ul class="nav_list">
					{if $member['enable']==1}
                        <li class="nav_item nav_cart">
                                <div style="padding: 10px 0 "><i class="iconal-wodefankui" style="background-color: #af7070"></i>我的推广</div>
                            <div class="nav_item_bd">
                                
                                <a  href="{php echo app_url('order/mycashorder',array('op' => '1'))}">
                                    <span class="nav_item_txt">未结算<br>￥<?php echo number_format($comp,2)?></span>
                                </a>
                                <a  href="{php echo app_url('order/mycashorder',array('op' => '2'))}">
                                    <span class="nav_item_txt">已结算<br>￥<?php echo number_format($member['billing'],2)?></span>
                                </a>
								<a  ><span class="nav_item_txt">未提现<br>￥<?php echo number_format($member['wallet'],2)?></span></a>
								<a  >
                                    <span class="nav_item_txt">已提现<br>￥<?php echo number_format($member['cash'],2)?></span>
                                </a>
                            </div>
                        </li>
						<li class="nav_item nav_green" >
							<div><i class="iconal-friendfill" style="background-color: #039702"></i><a href="{php echo app_url('order/team')}"> 我的客户</a></div>
						</li>
                        <li class="nav_item nav_red" >
                            <div><i class="iconal-lianjie" style="background-color:#e38d13"></i><a href="{php echo app_url('order/infojob')}"> 推广二维码</a></div>
                        </li>
                        <li class="nav_item nav_gold" >
                            <div><i class="iconal-wodehongbao" style="background-color: #006699"></i><a href="{php echo app_url('order/my_cash')}"> 立即提现 </a></div>
                        </li>
						{/if}
						{if $member['enable']!=1}
						 <li class="nav_item nav_order" >
                            <div><i class="iconal-gouwuche" style="background-color: #af7070"></i><a href="{php echo app_url('order/infojob')}"> 申请兼职 </a></div>
                        </li>
						
						{/if}
                    </ul>
                </div>
            </div>
			{if $member['enable']!=1}
			<div class="mod_footer">

            <div class="mod_footer_logo" style="position:relative;width: 130px;height: 130px;margin: 0 auto;">
            	 <img src="{php echo tomedia($share_images)}" alt="" class="img-rounded">
            </div>
			
        </div>
		{/if}
			        {loop $orders $order}
					 <?php 
					 $comprice=0;
					 $price=$order['price']-$order['cost_fee'];
if($order['g_id']>0)
{
	$sql3 = 'SELECT * FROM '.tablename('tg_goods').' WHERE id=:id';

                    $params3 = array(':id'=>$order['g_id']);

                    $good3 = pdo_fetch($sql3, $params3);

if($order['commissiontype']==2)
{$comprice=$order['commission'];}
else{$comprice=$price*$order['commission']/100;}

}else{
$sql3 = 'SELECT * FROM '.tablename('tg_collect').' WHERE uniacid=:uniacid and orderno=:orderno';
$params3 = array(':uniacid'=>$_W['uniacid'],'orderno'=>$order['orderno']);
 $favoriteqqq = pdo_fetchall($sql3, $params3);
	
				foreach ($favoriteqqq as $key => $orderss1) 
					{				
						
						$sql3 = 'SELECT * FROM '.tablename('tg_goods').' WHERE id=:id';

                    $params3 = array(':id'=>$orderss1['sid']);

                    $gs = pdo_fetch($sql3, $params3);
						if($gs['commissiontype']==2){$comprice+=$orderss1['commission'];}
					     else{
							 $comprice+=($orderss1['oprice']*$orderss1['num'])*$orderss1['commission']/100;//佣金计算			
						 }			
					}			
}
                    
          ?>
		  {if $op!=3}
					<div class="order" ms-repeat-order="orders">
					 <div class="order_hd">
					 
               {php echo date('Y-m-d H:i:s', $order['createtime']);}    {if $order['is_tuan']=='1'} 团单号：{$order['tuan_id']}{else}订单号：<?php echo substr($order['orderno'],-10);?>{/if}
					</div>
					<div class="order_bd">
                <div class="order_glist">
                    <!--获得商品的id-->
                    <!--end获得商品的id-->

                    <a href="{php echo app_url('goods/detail',array('id'=>$good3['id']))}">

                        <div class="order_goods" data-url="">

                            <div class="order_goods_img">
<img src="{$_W['attachurl']}{if empty($good3['share_gimg'])}{$good3['gimg']}{else}{$good3['share_gimg']}{/if}"style="width:60px;height:60px" alt="" title="">
                                

                            </div>

                            <div class="order_goods_info">

                                <div class="order_goods_name">{$good3['gname']}</div>

                                <div class="order_goods_attr">

                                    <div class="order_goods_attr_item">

                                        <div class="order_goods_price">提成：￥{$comprice}<i></i></div>

                                    </div>
								<div class="order_goods_attr_item">

                                  <span class="order_price" >金额：<b>￥{$price}</b></span>
  {if $order['commissiontype']==1}<span class="order_price" >提成比例：<b>{$order['commission']}%</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>{/if}

                                    </div>
                                </div>

                            </div>

                        </div>

                    </a>


                </div>

            </div>
					</div>
					{/if}
					{/loop}
        </section>
       
    </div>
</body>
<script>
	wx.ready(function () {
		var shareData = {
			title: "{$share_indexname}",
			desc: "{$share_indexdesc}",
			link: "{$tourl}",
			imgUrl: "{php echo tomedia($share_images)}",
		};
	//分享朋友
		wx.onMenuShareAppMessage({
		    title: shareData.title,
		  	desc: shareData.desc,
		  	link: shareData.link,
		  	imgUrl:shareData.imgUrl,
		  	trigger: function (res) {
		  	},
		  	success: function (res) {
		  	},
		  	cancel: function (res) {
		  	},
		  	fail: function (res) {
		    	alert(JSON.stringify(res));
		  	}
		});
	//朋友圈
		wx.onMenuShareTimeline({
		  	title: shareData.title,
		  	link: shareData.link,
		  	imgUrl:shareData.imgUrl,
		  	trigger: function (res) {
		  	},
		  	success: function (res) {
		  	},
		  	cancel: function (res) {
		  	},
		  	fail: function (res) {
		    	alert(JSON.stringify(res));
		  	}
		});
		var shareAddress = {php echo json_encode($shareAddress)};
		WeixinJSBridge.invoke('editAddress',shareAddress,function(res){ 
		    if(res.err_msg=='edit_address:ok'){
		        $("#myname").val(res.userName);
		        $('#myphone').val(res.telNumber);
		        $('#detailed_address').val(res.addressDetailInfo);
		        var city = res.proviceFirstStageName+" "+res.addressCitySecondStageName+" "+res.addressCountiesThirdStageName;
		        $('#city-picker').val(city);
		    }
		});
	});

</script>
</html>